package com.link.base.base.product.service;

import com.link.base.base.product.model.ShopCart;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

/**
 * @author unknown
 * @date unknown
 * @comments 购物车服务
 */
public interface ShopCartService extends BasicService<ShopCart> {


    /**
     * 通过用户ID清空购物车
     * @param entity 购物车
     * @throws Exception
     */
    public void deleteByEmpId(ShopCart entity) throws Exception;

    /**
     * 更新产品的数量
     * @param entity 购物车
     * @throws Exception
     */
    public void qtyUpdate(ShopCart entity) throws Exception;

    /**
     * 查询当前登录用户的购物车中的产品数量
     * @param entity 购物车
     * @return int
     * @throws Exception
     */
    public int queryEmpProdCount(ShopCart entity) throws Exception;

    /**
     * <p>根据订单id删除购物车中产品，用于购物车直接下单提交后执行删除</p>
     * <p>attr1 orderId</p>
     *
     * @author yrf
     * @param entity
     * @return int
     * @throws Exception
     */
    public int deleteByOrderId(ShopCart entity) throws Exception;

    /**
     * 区别登录状态，小程序使用accntId作为购物车的用户id
     *
     * @param entity
     * @return int
     * @throws Exception
     */
    @Override
    public List<ShopCart> queryByExamplePage(ShopCart entity) throws Exception;

    /**
     * 根据ID查询购物车，
     * 区别登录状态，小程序使用accntId作为购物车的用户id
     *
     * @param entity
     * @return 购物车
     * @throws Exception
     */
    @Override
    public ShopCart queryById(ShopCart entity) throws Exception;

    /**
     * 查询小程序产品list
     * @param entity
     * @return map
     * @throws Exception
     */
    Map<String,Object> queryByMpProdExamplePage(ShopCart entity) throws Exception;

    /**
     * MP 加入购物车
     * @author lujiang
     * @created 18-10-30
     * @param shopCart 购物车
     * @return map
     * @throws Exception
     */
    Map<String,Object> insertShopCart(ShopCart shopCart) throws Exception;

    /**
     * 查询购物车
     * @author lujiang
     * @created 18-10-30
     * @param shopC 购物车
     * @return 购物车列表
     * @throws Exception
     */
    List<ShopCart> queryByMpExamplePage(ShopCart shopC) throws Exception;

    /**
     * 修改购物车中选中状态
     * @param shopCart
     * @throws Exception
     */
    void selectedUpdate(ShopCart shopCart) throws Exception;
}
